#!/usr/bin/env python

'''App string resource

@author Julot <andy.julot@gmail.com>
@since Saturday, March 24, 2012. 05:25 PM


Changes Log:

1.0.0.1
! Auto fit image preview and open in default program on click.

1.0.0.0
+ Create document.'''

def _humanizeVersion(version):
    versions = version.split('.')
    stages = ('Alpha', 'Beta', 'Release Candidate', 'Public Release')
    if int(versions[2]) == 3:
        if int(versions[3]) == 0:
            r = '%s.%s' % (versions[0], versions[1])
        else:
            r = '%s.%s Revision %s' % (versions[0], versions[1], versions[3])
    else:
        if int(versions[3]) == 0:
            r = '%s.%s %s' % (versions[0], versions[1],
                              stages[int(versions[2])])
        else:
            r = '%s.%s %s %s' % (versions[0], versions[1],
                                 stages[int(versions[2])], versions[3])
    return r

def _humanizeDate(date):
    try:
        import dateutil.parser
        return dateutil.parser.parse(date)
    except:
        import datetime
        return datetime.datetime.now()
    
name = 'Aoi'
version = '1.0.0.1'
description = 'Document Scanner'
longDescription = 'Document Scanner'
trademarks = 'As I pray, unlimited syntax works'
copyright = 'Copyright 2012 Julot'
company = 'Seraphim'
author = 'Julot'
authorEmail = 'andy.julot@gmail.com'
blessing = 'May you do good and not evil.\r\n' \
         + 'May you find forgiveness for yourself and forgive others.\r\n' \
         + 'May you share freely, never taking more than you give.'
humanVersion = _humanizeVersion(version)

histories = {'0.0.0.0': '2012-04-12', '1.0.0.0': '2012-04-13',
             version: '2012-04-14'}
    
releaseDate = _humanizeDate(histories[version])
